package com.dong.ListNode.arithemtic;

/**
 * @author dcz
 * @classname Test
 * @description TODO
 * @date 2022/4/12 9:36
 */
public class Test {
    public ListNode reverseList(ListNode head) {
        ListNode pre = new ListNode();
        ListNode cur = head;
        while (cur != null){
            ListNode temp = cur.next;
            cur.next = pre;
            pre = cur;
            cur = temp;
        }
        return pre;
    }
}
